unit DashBoardForm;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, UDF, uADStanIntf, uADStanOption,
  uADStanError, uADGUIxIntf, uADPhysIntf, uADStanDef, uADStanPool, uADStanAsync,
  uADPhysManager, uADGUIxFormsWait, uADStanParam, uADDatSManager, uADDAptIntf,
  uADDAptManager, Vcl.StdCtrls, Vcl.Grids, Vcl.DBGrids, Data.DB, uADCompDataSet,
  uADCompClient, uADPhysMySQL, uADCompGUIx, uADPhysIB;

type
  TfmDashBoard = class(TForm)
    ADConnection1: TADConnection;
    ADPhysIBDriverLink1: TADPhysIBDriverLink;
    ADGUIxWaitCursor1: TADGUIxWaitCursor;
    ADPhysMySQLDriverLink1: TADPhysMySQLDriverLink;
    qryOverDue: TADQuery;
    dsOverDue: TDataSource;
    DBGrid1: TDBGrid;
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmDashBoard: TfmDashBoard;

implementation

{$R *.dfm}

procedure TfmDashBoard.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  CanClose := True;
  FreeAndNil(fmDashBoard);
end;

procedure TfmDashBoard.FormCreate(Sender: TObject);
var
  ADPhysDriverLink: TADPhysDriverLink;
  DriverID: string;
begin
  DriverID := DBDriverID;
  if DriverID = 'Firebird' then
    ADPhysDriverLink := ADPhysIBDriverLink1;
  if DriverID = 'MySQL' then
    ADPhysDriverLink := ADPhysMySQLDriverLink1;
  SetDBInfo(ADConnection1, ADPhysDriverLink);
  qryOverDue.Active := True;
end;

end.
